package com.trdcore.zyzkt.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.trdcore.zyzkt.model.order.OrderInfo;
import com.trdcore.zyzkt.resp.ResultData;
import com.trdcore.zyzkt.service.OrderInfoService;
import com.trdcore.zyzkt.vo.order.OrderInfoQueryVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 订单表 订单表 前端控制器
 * </p>
 *
 * @author Luffy
 * @since 2024-03-19
 */
@Tag(name = "订单管理")
@RestController
@RequestMapping(value="/admin/order/orderInfo")
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    @Operation(summary = "获取分页列表",description = "获取分页列表")
    @GetMapping("{page}/{limit}")
    public ResultData index(
            @Parameter(name = "page", description = "当前页码", required = true)
            @PathVariable("page") int page,
            @Parameter(name = "limit", description = "每页记录数", required = true)
            @PathVariable("limit") int limit,
            @Parameter(name = "orderInfoVo", description = "查询对象")
            OrderInfoQueryVo orderInfoQueryVo) {
        Page<OrderInfo> pageParam = new Page<>(page, limit);
        Map<String,Object> map = orderInfoService.selectOrderInfoPage(pageParam,orderInfoQueryVo);
        return ResultData.success(map);
    }
}

